/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xiaotutu
 * Date: 2023-10-18
 * Time: 15:16
 */
public class TestDate {
    public int year;
    public int month;
    public int day;

    public TestDate() {
        this.year = 2009;
        this.month = 10;
        this.day = 16;
        System.out.println("没有参数的构造方法!");
    }

    public TestDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("带三个参数的构造方法!");
    }

    public void setDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;

    }



    public void printDate() {
        System.out.println("年:"+ this.year + " 月:" + this.month + " 日:" + day);
    }

    public static void main(String[] args) {
        TestDate testDate1 = new TestDate(2000, 3, 7);
        TestDate testDate2 = new TestDate();
        TestDate testDate3 = new TestDate();
        /*        testDate1.setDate(2000, 3, 7);
        testDate1.printDate();*/
        testDate1.printDate();
        testDate2.printDate();
    }
}
